package ExceptionTest.Homework;
/*
用户注册类
 */
public class UserService {
    public void register(String username,String password) throws UserNameLengthException{
        if(username == null || username.length() < 6 || username.length() > 14){
            throw new UserNameLengthException("用户注册失败，请输入[6-14]长度的用户名");
        }
        System.out.println(username+"注册成功！");
    }
}

